﻿//-----------------------------------
//Author:Alvin
//Date:12:56:47
//-----------------------------------

using System;
using System.Runtime.InteropServices;
using DWORD = System.UInt32;
using WORD = System.UInt16;
using SCORE = System.Int64;
using SCOREEX = System.Double;

//游客登录
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_LogonVisitor
{
    //系统信息
    public WORD wModuleID; //模块标识
    public DWORD dwPlazaVersion; //广场版本
    public byte cbDeviceType; //设备类型

    public byte cbClientType; //客户端类型(H5/U3D/LUA)

    //连接信息
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MACHINE_ID)]
    public string szMachineID;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MOBILE_PHONE)] //机器标识
    public string szMobilePhone; //电话号码

    public DWORD dwSpreaderGameID; //推荐标识

    //附加信息
    public DWORD dwPackageID; //包id

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szPackageName; //包名

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szPackageVersion; //包版本
};

/// <summary>
/// CMD_GP_QueryIndividual
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_QueryIndividual
{
    public DWORD dwUserID;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szPassword;
}

//绑定推广
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_BindSpreader
{
    public DWORD dwUserID; //用户 I D

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)] //用户 I D
    public string szPassword; //用户密码

    public DWORD dwSpreaderID; //推广 ID
};

//修改资料
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_ModifyIndividual
{
    public byte cbGender; //用户性别
    public DWORD dwUserID;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)] //用户 I D
    public string szPassword; //用户密码
};

//查询赠送
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_QuerySendPresent
{
    public DWORD dwUserID; //用户 I D
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
struct CMD_GP_OperateSuccess
{
    public long lResultCode; //操作代码
};

//操作失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
struct CMD_GP_OperateFailure
{
    public long lResultCode; //错误代码
    public tagPromptString_L PromptString; //描述字符
};


[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_LogonSuccess
{
    public WORD wFaceID; //头像标识
    public byte cbGender; //用户性别
    public DWORD dwCustomID; //自定头像
    public DWORD dwUserID; //用户 I D
    public DWORD dwGameID; //游戏 I D

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szAccount; //用户帐号

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //用户昵称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szDynamicPass; //动态密码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MOBILE_PHONE)]
    public string szMobilePhone; //号码

    //财富信息
    public double lUserScore; //用户游戏币
    public double lUserInsure; //用户银行	
    public UInt64 lDiamond; //钻石
    public double lWithDrawScore; //提现金额
    public double lServiceFee; //服务费
    public double lRechargeAmount; //充值额

    //扩展信息
    public byte cbInsureEnabled; //使能标识
    public byte cbEnjoinYuEBao; //余额宝服务标识(0为开启服务)
    public byte cbYuEBaoEnabled; //开通余额宝标识(1为开通)
    public byte cbIsAgent; //代理标识
    public byte cbMoorMachine; //锁定机器
    public byte cbIsNewUser; //新用户登录
    public DWORD dwLockServerID; //锁定房间
    public DWORD dwLockKindID; //游戏类型
    public int nAwardTicket; //用户奖劵
}

//登录失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_LogonFailure
{
    public Int32 lResultCode; //错误代码
    public tagPromptString_L PromptString; //提示语
};

//升级账号成功
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_UpdateSuccess
{
    //用户属性
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szAccounts; //用户帐号

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_ACCOUNTS)]
    public string szNickName; //用户昵称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MOBILE_PHONE)]
    public string szMobilePhone; //电话号码


    //用户成绩
    public double lUserScore; //用户游戏币
    public double lUserInsure; //用户银行	
    public SCORE lDiamond; //钻石
    public int nAwardTicket; //用户奖劵
    public WORD wCustomID; //用户头像
};

//更新失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_UpdateFailure
{
    Int32 lResultCode; //错误代码
    tagPromptString_L PromptString; //提示语
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_CS_C_RegisterServer
{
    public WORD wKindID; //名称索引
    public WORD wNodeID; //节点索引
    public WORD wSortID; //排序索引
    public WORD wServerID; //房间索引
    public WORD wServerKind; //房间类别
    public WORD wServerType; //房间类型		
    public WORD wServerLevel; //房间等级
    public WORD wServerPort; //房间端口

    public double lCellScore; //单元积分
    public byte cbEnterMember; //进入会员
    public double lEnterScore; //进入积分
    public double lMaxTableScore; //最高积分(为0无效)

    public DWORD dwServerRule;
    public DWORD dwOnLineCount; //在线人数
    public DWORD dwAndroidCount; //机器人数
    public DWORD dwFullCount; //满员人数

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szServerAddr; //服务地址

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_SERVER)]
    public string szServerName; //房间名称

    public byte cbRoomTag; //
    public DWORD dwSurportType;
    public WORD wTableCount; //设置人数
    public DWORD dwSetPlayerCount;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_SERVER)]
    public string szGameInfomation; //游戏说明
};

//标签房间
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_ServerTagRes
{
    public byte cbCode; //错误代码(0.正常)
    public DWORD dwUserID; //用户ID
    public WORD wKindID; //游戏ID
    public WORD wServerCount; //房间数量

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
    public WORD[] wServerID; //房间ID列表
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagU3DGameKind
{
    public WORD wKindID; //游戏ID

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szKindName; //游戏名字

    public WORD wTypeID; //挂接索引
    public WORD wSortID; //排序索引

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szModuleName; //进程名字

    public DWORD dwClientVersion; //客户端版本号
    public DWORD dwResVersion; //推荐游戏
    public byte cbNullity; //禁用标志 0 不禁用 1 禁用
}

/// <summary>
/// 个人资料
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_UserIndividual
{
    public DWORD dwUserID; //用户uid
}

/// <summary>
/// 操作成功
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_OperateSuccess
{
    public int lResultCode; //操作代码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public String szDescribeString; //错误信息
}

/// <summary>
/// 操作失败
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GC_OperateFailure
{
    public int lErrorCode; //错误代码
    public int lResultCode; //操作代码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MESSAGE_CONTENT)]
    public string szDescribeString; //错误信息
}


//资料结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_IndividuaResult
{
    public bool bSuccessed; //成功标识
    public SCOREEX lCurrScore; //当前金币
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_UserFaceInfo
{
    public WORD wFaceID; //头像标识
    public DWORD dwCustomID; //自定标识
};


//银行资料
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_UserInsureInfo
{
    public byte cbEnjoinTransfer; //转账开关
    public WORD wServiceFeeTake; //服务费比例
    public WORD wServiceFeeTransfer; //服务费比例
    public WORD wServiceFeeTransferMember; //服务费比例
    public WORD wServerID; //房间标识
    public SCOREEX lUserScore; //用户金币
    public SCOREEX lUserInsure; //银行金币
    public SCOREEX lTransferPrerequisite; //转账条件
    public DWORD dwUserRight; //用户权限

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = Protocal.LEN_BANKEROP_BT)]
    public SCORE[] lBankOPButtonArray; //银行存取操作按钮数组(后两位为全存全取，大厅银行为0)
};

/// <summary>
/// 开通结果
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMP_GP_UserInsureEnableResult
{
    public byte cbInsureEnabled; //使能标识
    public tagPromptString_L PromptString; //提示语
};

//银行成功
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMP_GP_UserInsureSuccess
{
    public DWORD dwUserID; //用户 I D
    public SCOREEX lUserScore; //用户金币
    public SCOREEX lUserInsure; //银行金币
};

//银行失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMP_GP_UserInsureFailure
{
    public Int64 lResultCode; //错误代码
    public tagPromptString_L PromptString; //提示语
};

//查询签到
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_CheckInQueryInfo
{
    public DWORD dwUserID; //用户标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szPassword; //登录密码

    public int nPlatformKindID; //平台类型 0 通用 1-LUA  2-H5 3-u3d
}


//签到信息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_CheckInInfo
{
    public WORD wSeriesDate; //连续日期
    public bool bTodayChecked; //签到标识

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
    public DWORD[] nGotPackageID; //已领礼包

    public DWORD nPackCount; //礼包总数
};


//转盘信息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_TurnTableInfo
{
    public byte cbIsDone; //日是否已抽奖 0-否 1-是
    public byte cbLeftTimes; //剩余抽奖次数

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
    public double[] dItemScore; //盘配置金额

    public double dPoolScore; //奖池
    public double dLimitScore; //赠送次数所需输赢分
}

//执行抽奖(请求)
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_GiftTurnPlate_Start
{
    public DWORD dwUserID;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MACHINE_ID)]
    public string szMachineID;
}

/// <summary>
/// 执行抽奖(回复)
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_GiftTurnPlate_StartResult
{
    public int nErrorCode;
    public byte cbLeftTimes;
    public byte cbIndex;
    public SCOREEX dScore;
}

// 获取玩家财富信息结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_GetUserWealthResult
{
    public double lScore; //携带金币
    public double lInsure; //银行金币
    public SCORE lDiamond; //钻石
    public SCORE lAwardTicket; //返奖券
}

///////////////////////////////////////////////////////////////////////////////
/// 远程服务
//协调查找
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_C_SearchCorrespond
{
    public DWORD dwGameID; //游戏标识
    public string szNickName; //用户昵称
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_C_SearchAllCorrespond
{
    public DWORD dwCount;

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
    public DWORD[] dwGameID; //游戏标识
};

//协调查找
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_S_SearchCorrespond
{
    public WORD wUserCount; //用户数目

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
    public tagUserRemoteInfo[] UserRemoteInfo; //用户信息
};

[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_S_SearchAllCorrespond
{
    public DWORD dwCount;

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
    public tagUserRemoteInfo[] UserRemoteInfo; //用户信息				
};

//////////////////////////////////////////////////////////////////////////////////
//道具命令
//道具失败
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_PropertyFailure
{
    public Int64 lErrorCode; //错误代码
    public tagPromptString_L PromptString; //提示语
};

//购买道具
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_PropertyBuy
{
    public DWORD dwUserID; //用户 I D
    public DWORD dwPropertyID; //道具标识
    public byte cbUseKind; //购买类型(0钻石1金币)
    public DWORD dwPropCount; //道具数目	

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szPassword; //登录密码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MACHINE_ID)]
    public string szMachineID; //机器序列
};

//查询单个
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_PropertyQuerySingle
{
    public DWORD dwUserID; //用户 I D
    public DWORD dwPropertyID; //道具标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szPassword; //登录密码
};

//查询结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_PropertyQuerySingleResult
{
    public DWORD dwUserID; //用户 I D
    public DWORD dwPropertyID; //道具标识
    public DWORD dwItemCount; //道具数目
};

//道具成功
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_S_PropertySuccess
{
    public DWORD dwUserID;
    public DWORD dwPropertyID;
    public DWORD dwItemCount;
    public SCORE lDiamond;
    public tagPromptString_L PromptString;
}

//登陆
//发包结构
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_MB_LogonOtherPlatform
{
    public WORD wModuleID; //模块标识
    public DWORD dwPlazaVersion; //广场版本
    public byte cbDeviceType; //设备类型

    //注册信息
    public byte cbGender; //用户性别
    public byte cbPlatformID; //平台编号

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_USER_UIN)]
    public string szUserUin; //登陆帐号

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_NICKNAME)]
    public string szNickName; //用户昵称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_COMPELLATION)]
    public string zsCompellation; //真实名字

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MACHINE_ID)]
    public string szMachineID; //机器标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_MOBILE_PHONE)]
    public string szMobilePhone; //电话号码

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_FACE_URL)]
    public string strFaceUrl; //电话号码
}

//道具信息
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct tagPropertyItem
{
    //道具信息
    public DWORD dwPropertyID; //道具标识
    public DWORD dwPropertyKind; //功能类型

    public byte cbUseArea; //使用范围
    public byte cbServiceArea; //对象范围
    public byte cbRecommend; //推荐标识

    public byte cbExchangeType; //兑换类型
    public SCOREEX dwExchangeRatio; //钻石兑换道具比率

    //获得财富
    public SCORE lSendLoveLiness; //获得魅力（赠送方）
    public SCORE lRecvLoveLiness; //获得魅力（接收方）
    public SCOREEX lUseResultsGold; //获得金币

    //持续效果
    public DWORD dwUseResultsValidTime; //有效时间
    public DWORD dwUseResultsValidTimeScoreMultiple; //有效倍率

    //礼物拆包
    public DWORD dwUseResultsGiftPackage; //礼物拆包
    public DWORD dwSortID; //排序标识

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
    public string szName; //道具名称

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
    public string szRegulationsInfo; //使用信息

    public byte cbPlatformKind; //平台编号0:全部 1:LUA,2:H5,3:U3D
};

//获取断线信息结果
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_GetOffLineInfoResult
{
    public DWORD dwServerID;
    public WORD wKindID;
}


/// <summary>
/// 查询银行
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct CMD_GP_QueryInsureInfo
{
    public DWORD dwUserID;//用户id
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Protocal.LEN_PASSWORD)]
    public string szPassword;//用户密码
}


	

